package com.example.batch.dbconfig;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration("batchDataSourceConfig")
public class BatchDataSourceConfig {

    @Bean(name = "batchDataSource")
    @Qualifier("batchDataSource")
    @ConfigurationProperties(prefix = "batch.datasource")
    public DataSource dataSource() {
        return DataSourceBuilder.create().build();
    }
}
